(y > bhi ||
(best_val(&v[klo], min(ahi-x, bhi-y)) < best[v[klo].c].val &&
best_val(&v[klo+1], min(ahi-x, bhi-y+1)) < best[v[klo+1].c].val
- )
- )) {
+ )
+ )) {
klo += 2;
x = (klo+f)/2; y = x-klo;
}
(v[khi].c >= 0 &&
best_val(&v[khi], min(ahi-x, bhi-y)) < best[v[khi].c].val &&
best_val(&v[khi-1], min(ahi-x+1, bhi-y)) < best[v[khi].c].val
- )
- )) {
+ )
+ )) {
khi -= 2;
x = (khi+f)/2; y = x - khi;
}
while (xlo > xmin && !ends_line(a.list[xlo-1]))
xlo--;
csl2 = wiggle_diff_partial(a, b,
- xlo, best[i].xlo,
- ylo, best[i].ylo);
+ xlo, best[i].xlo,
+ ylo, best[i].ylo);
csl1 = wiggle_csl_join(csl1, csl2);
}
* good match
*/
csl2 = wiggle_diff_partial(a, b,
- best[i].xlo, best[i].xhi,
- best[i].ylo, best[i].yhi);
+ best[i].xlo, best[i].xhi,
+ best[i].ylo, best[i].yhi);
csl1 = wiggle_csl_join(csl1, csl2);
/* Now if there are newlines at the end of the
xhi++;
}
csl2 = wiggle_diff_partial(a, b,
- best[i].xhi, xhi,
- best[i].yhi, yhi);
+ best[i].xhi, xhi,
+ best[i].yhi, yhi);
csl1 = wiggle_csl_join(csl1, csl2);
xmin = xhi;
}
* subranges of files.
*/
struct csl *wiggle_diff_partial(struct file a, struct file b,
- int alo, int ahi, int blo, int bhi)
+ int alo, int ahi, int blo, int bhi)
{
struct v *v;
struct cslb cslb = {};
/*
* extract parts of a "diff3 -m" or "wiggle -m" output
*/
-int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2, struct stream *f3)
+int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2,
+ struct stream *f3)
{
int state = 0;
char *cp, *end;
}
int wiggle_isolate_conflicts(struct file af, struct file bf, struct file cf,
- struct csl *csl1, struct csl *csl2, int words,
- struct merge *m, int show_wiggles,
- int *wigglesp)
+ struct csl *csl1, struct csl *csl2, int words,
+ struct merge *m, int show_wiggles,
+ int *wigglesp)
{
/* A Conflict indicates that something is definitely wrong
* and so we need to be a bit suspicious of nearby apparent matches.
}
struct ci wiggle_make_merger(struct file af, struct file bf, struct file cf,
- struct csl *csl1, struct csl *csl2, int words,
- int ignore_already, int show_wiggles)
+ struct csl *csl1, struct csl *csl2, int words,
+ int ignore_already, int show_wiggles)
{
/* find the wiggles and conflicts between csl1 and csl2
*/
rv.merger[i].type = Conflict;
}
rv.conflicts = wiggle_isolate_conflicts(af, bf, cf, csl1, csl2, words,
- rv.merger, show_wiggles, &rv.wiggles);
+ rv.merger, show_wiggles, &rv.wiggles);
return rv;
}
"", " border"," conflict"," wiggle" };
int wiggle_print_merge(FILE *out, struct file *a, struct file *b, struct file *c,
- int words, struct merge *merger,
- struct merge *mpos, int streampos, int offsetpos)
+ int words, struct merge *merger,
+ struct merge *mpos, int streampos, int offsetpos)
{
struct merge *m;
int lineno = 1;
/* Nothing more to report */
break;
if (cm->in_conflict == 1 &&
- (cm->type == Extraneous ||
- cm->type == Unmatched ||
- cm->type == Unchanged))
+ (cm->type == Extraneous ||
+ cm->type == Unmatched ||
+ cm->type == Unchanged))
/* border between conflicts, but
* still nothing to report.
*/
struct ci ci;
int chunks;
sp = wiggle_load_segment(f, pl->start,
- pl->end);
+ pl->end);
if (reverse)
chunks = wiggle_split_patch(sp, &sa, &sb);
else
}
pl = wiggle_sort_patches(pl, &num_patches);
main_window(pl, num_patches, in, reverse, replace, ignore_blanks,
- just_diff, backup);
+ just_diff, backup);
wiggle_plist_free(pl, num_patches);
fclose(in);
break;
}
pl = wiggle_sort_patches(pl, &num_patches);
main_window(pl, num_patches, f, reverse, replace,
- ignore_blanks, just_diff, backup);
+ ignore_blanks, just_diff, backup);
wiggle_plist_free(pl, num_patches);
} else if (strlen(argv[0]) > 4 &&
- strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) {
+ strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) {
char *origname = strdup(argv[0]);
origname[strlen(origname) - 4] = '\0';
show_merge(origname, f, reverse, 0, NULL, NULL,
if (fl[0].list[a].start[0]) {
printf("-");
wiggle_printword(stdout,
- fl[0].list[a]);
+ fl[0].list[a]);
}
a++;
exit_status = 1;
if (fl[1].list[b].start[0]) {
printf("+");
wiggle_printword(stdout,
- fl[1].list[b]);
+ fl[1].list[b]);
}
b++;
exit_status = 1;
else {
printf(" ");
wiggle_printword(stdout,
- fl[0].list[a]);
+ fl[0].list[a]);
}
a++;
b++;
if (which == '2')
chunks2 = chunks3 =
wiggle_split_patch(f, &flist[2],
- &flist[1]);
+ &flist[1]);
else
chunks2 = chunks3 =
wiggle_split_patch(f, &flist[1],
- &flist[2]);
+ &flist[2]);
} else
flist[1] = wiggle_load_file(argv[1]);
extern void wiggle_plist_free(struct plist *pl, int num);
extern struct plist *wiggle_parse_patch(FILE *f, FILE *of, int *np);
extern struct stream wiggle_load_segment(FILE *f, unsigned int start,
- unsigned int end);
+ unsigned int end);
extern int wiggle_set_prefix(struct plist *pl, int n, int strip);
extern struct stream wiggle_load_file(char *name);
extern int wiggle_split_patch(struct stream, struct stream*, struct stream*);
extern int wiggle_split_merge(struct stream, struct stream*, struct stream*,
- struct stream*);
+ struct stream*);
extern struct file wiggle_split_stream(struct stream s, int type);
extern struct csl *wiggle_pdiff(struct file a, struct file b, int chunks);
extern struct csl *wiggle_diff(struct file a, struct file b, int shortest);
extern struct csl *wiggle_diff_patch(struct file a, struct file b, int shortest);
extern struct csl *wiggle_diff_partial(struct file a, struct file b,
- int alo, int ahi, int blo, int bhi);
+ int alo, int ahi, int blo, int bhi);
extern struct csl *worddiff(struct stream f1, struct stream f2,
struct file *fl1p, struct file *fl2p);
extern struct csl *wiggle_csl_join(struct csl *c1, struct csl *c2);